<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets" 
    xmlns:f="http://java.sun.com/jsf/core" 
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:p="http://primefaces.org/ui">
 
     <ui:composition template="../resources/template.xhtml">
	    <ui:define name="conteudo">
	      <h:form id="form">
	      <div style="float: inherit; width: 100%; text-align: center;">
	        	<p:panel header="Pesquisa" styleClass="panelPesquisa" >
		            <h:outputText value="Categoria:  "/> 
		             
					<h:selectOneMenu id="categoria" value="#{pesquisa.pkCategoria}" style="width:450px; text-align:center;">  
					    <f:selectItem itemLabel="-- Selecione a categoria -- " itemValue="0" style="text-align:center;"/>    
					    <f:selectItems value="#{pesquisa.categorias}" var="c"  itemValue="#{c.pkFilmeCategoria}" style="text-align:center;"/>  
					</h:selectOneMenu>    
					
					<h:outputText value="  "/> 
	                <p:commandButton id="form" action="#{pesquisa.buscarFilme}" value="Buscar" ajax="false" /> 
		    	</p:panel>
		    
	        
		       <br/>
		        <p:carousel id="carouselPesquisaFilme" value="#{pesquisa.filmes}" var="filmeSelecionado" headerText=""  circular="true" style="width:100%" >  
			       <p:panel header="#{filmeSelecionado.titulo}" style="text-align:center; width:390px;">  
			       		<p:graphicImage id="image" value="/imagensProjeto/filmes/filme_#{filmeSelecionado.codigo}.jpg" height="300"/>   
			            <h:panelGrid columns="2"> 
			            	Produtora:
			                <h:outputText value="#{filmeSelecionado.produtora}" />  
			         	</h:panelGrid>
			         	<p:commandLink id="view" update=":form:filmeDetalhe" oncomplete="filmeDialog.show()" title="Ver detalhes">  
				            <h:outputText styleClass="ui-icon ui-icon-search" style="margin:0 auto;" />   
				            <f:setPropertyActionListener value="#{filmeSelecionado}" target="#{pesquisa.filmeSelecionado}" />  
	                   </p:commandLink>  
			        </p:panel>   
			   </p:carousel>  
			   <ui:include src="/paginas/detalheFilme.xhtml"/>
			    </div>
	      </h:form>
	   </ui:define>
  </ui:composition>
 
</html>


